package com.yu.controller;

import com.yu.entity.Sale;
import com.yu.service.SaleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Sale)表控制层
 *
 * @author makejava
 * @since 2021-07-01 14:32:36
 */
@Controller
@RequestMapping("sale")
public class SaleController {
    /**
     * 服务对象
     */
    @Resource
    private SaleService saleService;

    /**
     * 查询所有销售记录queryAllsale
     * @param
     * @return
     */
    @RequestMapping("queryAllsale")
    @ResponseBody
    List<Sale> queryAllsale(){
        return this.saleService.queryAllsale();
    }


    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Sale selectOne(Integer id) {
        return this.saleService.queryById(id);
    }

}
